package metu.tespit.session.util;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.security.Identity;

/**
 
 * @created Jun 9, 2012
 */
@Name("redirector")
public class Redirector {
	
	@In
	Identity identity;
	
	public String getRedirect(){
		
		if(identity.isLoggedIn()){
			if(!identity.hasRole("Student")){
				
				return "Instructor/InstructorHome.seam";
			}
			else{
				return "Student/StudentHome.seam";
			}
		}
		return "login.seam";
	}
}
